<?php 
$this->headLink(array('href' => '/cms/styles/style.css', 'rel' => "stylesheet", 'type' => "text/css"));

$this->layout()->body_attr = 'class="modal"';
?>
<form method="post" action="">
  <table class="form" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>&nbsp;</td>
      <td><h1 id="winTitle">Добавление контента</h1></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="lablel">Название:</td>
      <td><input type="text" value="<?= $this->values['name'] ?>" name="name" id="name" class="modalInput" style="width:400px" />
<?php 
if (isset($this->errors)) {
	if (isset($this->errors['name'])) {
?>
		<ul class="errors">
		<?php for ($e=0;$e<count($this->errors['name']);$e++) { ?>
			<li><?= $this->errors['name'][$e]?></li>
		<?php } ?>
		</ul>
<?php 		
	}
}
?>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="lablel">Тип:</td>
      <td><select name="type" id="type" class="modalInput" style="width:400px">
        <option value="">Выберите тип</option>
<?php foreach ($this->avalible_content as $content) {
	echo "<option value=\"{$content[0]}\"".($content[0]==$this->values['type'] ? ' selected="selected"' : '').">{$content[1]}</option>";
}
?>
        
      </select>
<?php 
if (isset($this->errors)) {
	if (isset($this->errors['type'])) {
?>
		<ul class="errors">
		<?php for ($e=0;$e<count($this->errors['type']);$e++) { ?>
			<li><?= $this->errors['type'][$e]?></li>
		<?php } ?>
		</ul>
<?php 		
	}
}
?>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" class="okButton" id="okButton" value="Сохранить" />
          <input type="button" class="okButton" value="Отмена" onclick="window.parent.setTimeout('Shadowbox.close()',10)" /></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>